import { init } from 'snabbdom/src/package/init'
import { h } from 'snabbdom/src/package/h' // helper function for creating vnodes
console.log(init)
console.log(h)

const patch = init([])
const container = document.getElementById('root')
let vNode = h('div#app.cls', [
  'hello world',
  h('div', 'div dom'),
  h('p', 'p dom')
]);
const oldDom = patch(container, vNode);

setTimeout(() => {
  vNode = h('div#app.cls', [
    h('h1', 'hello world'),
    h('p', 'hello p'),
  ])
  patch(oldDom, vNode);
}, 2000);

setTimeout(() => {
  patch(oldDom, h('!'));
}, 4000);